<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<script type="text/javascript">
    function postBack()
    {
        $("#analysisResults").load(window.location + "&noCache=" + Math.random() + " #ajaxContent");
    }
    setInterval("postBack()",10000); // milliseconds: 10000 = 10 seconds
</script>
<div id="analysisResults" class="content">
    <div id="ajaxContent">
        <h2>Analysis Results</h2>
        <logic:present name="analysisResultsForm" property="job.status">
            <logic:empty name="analysisResultsForm" property="job.pvalue">
                <p>Your analysis is not complete yet. Please wait.</p>
                <p>The page will automatically refresh every 10 seconds to check whether the job has been completed.</p>
            </logic:empty>
            <p>
                Your jobs current status is: <strong><bean:write name="analysisResultsForm" property="job.status" /></strong>
            </p>
            <logic:notEmpty name="analysisResultsForm" property="job.pvalue">
                <p>pvalue = <bean:write  name="analysisResultsForm" property="job.pvalue" /></p>
            </logic:notEmpty>
        </logic:present>
        <logic:notPresent name="analysisResultsForm" property="job.status">
            <p>Invalid jobID please verify your job link.</p>
        </logic:notPresent>
    </div>
</div>